using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.IO;

namespace Animation_Editor
{



    public partial class Form1 : Form
    {

        public Form1()
        {
            InitializeComponent();
        }

        private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

        private void toolStripContainer1_ContentPanel_Load(object sender, EventArgs e)
        {

        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void statusStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

        private void toolStripStatusLabel1_Click(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            customControl11.data.LoadedAnimation1.CzAnimationName = "Default";

            AnimationNameBox.Text = customControl11.data.LoadedAnimation1.CzAnimationName;

            customControl11.data.LoadedFrame1.NFrameNumber = 0;
            customControl11.data.LoadedFrame1.RFrameRect = new Rectangle(0, 0, 0, 0);
            customControl11.data.LoadedFrame1.PtAnchorPoint = new Point(0, 0);
            customControl11.data.LoadedAnimation1.LFrames = new List<Frame>();

        }

        private void numericUpDown4_ValueChanged(object sender, EventArgs e)
        {

        }

        private void label1_Click_1(object sender, EventArgs e)
        {

        }

        private void groupBox2_Enter(object sender, EventArgs e)
        {

        }

        private void loadSpriteSheerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            if (DialogResult.OK == dlg.ShowDialog())
            {
                customControl11.SpriteSheet = new Bitmap(dlg.FileName);
                previewControl1.SpriteSheet = new Bitmap(dlg.FileName);
                customControl11.data.CzFileName = dlg.FileName;
                Invalidate();
            }

        }

        private void button7_Click(object sender, EventArgs e)
        {

            FrameListBox.Items.Add(customControl11.data.Loadedframenumber);
            customControl11.data.Loadedframenumber++;
            customControl11.data.LoadedFrame1.LCollisionRects.Add(customControl11.collrect);
            customControl11.collrect = new Rectangle();


            customControl11.data.LoadedAnimation1.LFrames.Add(customControl11.data.LoadedFrame1);
            previewControl1.Frames.Add(customControl11.data.LoadedFrame1);

            customControl11.data.LoadedFrame1 = new Frame();
            customControl11.data.LoadedFrame1.LCollisionRects = new List<Rectangle>();
            Invalidate();
            customControl11.Invalidate();

            TriggerList.Items.Clear();
            listBox3.Items.Clear();

        }

        private void button1_Click(object sender, EventArgs e)
        {
            customControl11.Toolstate = 1;
            customControl11.rectfinish = false;
        }

        private void label10_Click(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            customControl11.Toolstate = 2;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            customControl11.Toolstate = 3;
            customControl11.collfinish = false;
        }

        private void Add_Click(object sender, EventArgs e)
        {
            Trigger temp = new Trigger();
            temp.CzTrigger = TriggerText.Text;
            temp.NTriggerType = 0;
            customControl11.data.LoadedFrame1.FFrameTriggers.Add(temp);
            TriggerList.Items.Add(temp.CzTrigger);
            TriggerText.Clear();
        }

        private void button22_Click(object sender, EventArgs e)
        {
            customControl11.data.LoadedFrame1.FFrameTriggers.RemoveAt(TriggerList.SelectedIndex);
            TriggerList.Items.RemoveAt(TriggerList.SelectedIndex);
        }

        private void button8_Click(object sender, EventArgs e)
        {
            customControl11.data.LoadedAnimation1.LFrames.RemoveAt(FrameListBox.SelectedIndex);
            FrameListBox.Items.RemoveAt(FrameListBox.SelectedIndex);
        }

        private void FrameListBox_SelectedIndexChanged(object sender, EventArgs e)
        {

            if (FrameListBox.SelectedIndex == customControl11.selectedframe)
            {
                FrameListBox.ClearSelected();
            }

            customControl11.selectedframe = FrameListBox.SelectedIndex;

            if (customControl11.selectedframe > -1)
            {
                TriggerList.Items.Clear();
                for (int i = 0; i < customControl11.data.LoadedAnimation1.LFrames[customControl11.selectedframe].FFrameTriggers.Count; i++)
                {
                    TriggerList.Items.Add(customControl11.data.LoadedAnimation1.LFrames[customControl11.selectedframe].FFrameTriggers[i].CzTrigger);
                }
                customControl11.Invalidate();
            }

        }

        private void label9_Click(object sender, EventArgs e)
        {

        }

        private void numericUpDown3_ValueChanged(object sender, EventArgs e)
        {
            Point temp = new Point();
            temp = customControl11.data.LoadedFrame1.PtAnchorPoint;
            temp.X = (int)numericUpDown3.Value;
            customControl11.data.LoadedFrame1.PtAnchorPoint = temp;
        }

        private void label8_Click(object sender, EventArgs e)
        {

        }

        private void numericUpDown6_ValueChanged(object sender, EventArgs e)
        {

        }

        private void numericUpDown3_MouseClick(object sender, MouseEventArgs e)
        {

        }

        private void Form1_MouseClick(object sender, MouseEventArgs e)
        {

        }

        private void button12_Click(object sender, EventArgs e)
        {
            previewControl1.Frames = customControl11.data.LoadedAnimation1.LFrames;
            previewControl1.SpriteSheet = customControl11.SpriteSheet;
            previewControl1.Play = true;
           
        }

        private void button13_Click(object sender, EventArgs e)
        {
            previewControl1.Play = false;
            previewControl1.CurrentFrame = 0;
            previewControl1.Invalidate();
        }

        private void FrameListBox_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            customControl11.data.LoadedFrame1 = customControl11.data.LoadedAnimation1.LFrames[FrameListBox.SelectedIndex];
            listBox3.Items.Clear();
            for (int j = 0; j < customControl11.data.LoadedAnimation1.LFrames[FrameListBox.SelectedIndex].LCollisionRects.Count; j++)
            {
                listBox3.Items.Add(j);
            }
            Invalidate();
            customControl11.Invalidate();
        }

        private void button20_Click(object sender, EventArgs e)
        {
            customControl11.data.LoadedFrame1.LCollisionRects.Add(customControl11.collrect);
            customControl11.collrect = new Rectangle();
            listBox3.Items.Add(customControl11.collnumber);
            customControl11.collnumber++;
        }

        private void button9_Click(object sender, EventArgs e)
        {
            customControl11.data.LoadedAnimation1.CzAnimationName = AnimationNameBox.Text;

            customControl11.data.Animations.Add(customControl11.data.LoadedAnimation1);
            listBox2.Items.Add(customControl11.data.LoadedAnimation1.CzAnimationName);
            customControl11.data.LoadedAnimation1 = new Animation();
            customControl11.data.LoadedAnimation1.CzAnimationName = "Default";
            AnimationNameBox.Text = customControl11.data.LoadedAnimation1.CzAnimationName;
            customControl11.data.LoadedFrame1.NFrameNumber = 0;
            customControl11.data.LoadedFrame1.RFrameRect = new Rectangle(0, 0, 0, 0);
            customControl11.data.LoadedFrame1.PtAnchorPoint = new Point(0, 0);
            customControl11.data.LoadedAnimation1.LFrames = new List<Frame>();

        }

        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void xMLToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            SaveFileDialog dlg = new SaveFileDialog();
            dlg.Filter = "All Files|*.*|Xml Files|*.xml";
            dlg.FilterIndex = 2;
            dlg.DefaultExt = "xml";

            if (customControl11.data.Animations.Count == 0)
            {
                MessageBox.Show("You haven't done any work yet... if you have, make sure to add the animation you made to the animation list.", "Do work son", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (DialogResult.OK == dlg.ShowDialog())
            {


                XmlWriterSettings settings = new XmlWriterSettings();
                settings.ConformanceLevel = ConformanceLevel.Document;
                settings.Indent = true;

                using (XmlWriter writer = XmlWriter.Create(dlg.FileName, settings))
                {
                    writer.WriteStartElement("Animations");
                    writer.WriteAttributeString("File", customControl11.data.CzFileName);

                    Rectangle check = new Rectangle();



                    for (int i = 0; i < customControl11.data.Animations.Count; i++)
                    {
                        writer.WriteStartElement("Animation");

                        writer.WriteElementString("Name", customControl11.data.Animations[i].CzAnimationName);
                        writer.WriteStartElement("Frames");
                        for (int a = 0; a < customControl11.data.Animations[i].LFrames.Count; a++)
                        {


                            writer.WriteStartElement("Frame");
                            writer.WriteAttributeString("Number", a.ToString());
                            
                            writer.WriteAttributeString("FrameRect", customControl11.data.Animations[i].LFrames[a].RFrameRect.Top.ToString() 
                                                        + "," + customControl11.data.Animations[i].LFrames[a].RFrameRect.Left.ToString()
                                                        + "," + customControl11.data.Animations[i].LFrames[a].RFrameRect.Bottom.ToString() 
                                                        + "," + customControl11.data.Animations[i].LFrames[a].RFrameRect.Right.ToString());

                            writer.WriteAttributeString("AnchorPoint", customControl11.data.Animations[i].LFrames[a].PtAnchorPoint.X.ToString() + "," + customControl11.data.Animations[i].LFrames[a].PtAnchorPoint.Y.ToString())  ;

                            for (int c = 0; c < customControl11.data.Animations[i].LFrames[a].LCollisionRects.Count; c++)
                            {
                                if (customControl11.data.Animations[i].LFrames[a].LCollisionRects[c] == check)
                                {
                                    break;
                                }

                                writer.WriteStartElement("CollisionBox");
                              
                                writer.WriteAttributeString("CollisionRect", customControl11.data.Animations[i].LFrames[a].LCollisionRects[c].Top.ToString() + ","
                                                                             + customControl11.data.Animations[i].LFrames[a].LCollisionRects[c].Left.ToString() + ","
                                                                             + customControl11.data.Animations[i].LFrames[a].LCollisionRects[c].Bottom.ToString() + ","
                                                                             + customControl11.data.Animations[i].LFrames[a].LCollisionRects[c].Right.ToString());
                                writer.WriteEndElement();

                            }


                            for (int d = 0; d < customControl11.data.Animations[i].LFrames[a].FFrameTriggers.Count; d++)
                            {
                                writer.WriteStartElement("Trigger");
                                writer.WriteAttributeString("Type", "0");
                                writer.WriteAttributeString("String", customControl11.data.Animations[i].LFrames[a].FFrameTriggers[d].CzTrigger);
                                writer.WriteEndElement();
                            }


                            writer.WriteEndElement();



                        }
                        writer.WriteEndElement();
                        writer.WriteEndElement();
                    }


                    writer.WriteEndElement();
                }
            }
        }

        private void saveToolStripButton_Click(object sender, EventArgs e)
        {
            xMLToolStripMenuItem1_Click(sender, e);

        }

        private void xMLToolStripMenuItem_Click(object sender, EventArgs e)
        {
             OpenFileDialog openFileDialog1 = new OpenFileDialog();

             if (DialogResult.OK == openFileDialog1.ShowDialog())
             {
                 XmlReaderSettings settings = new XmlReaderSettings();
                 settings.ConformanceLevel = ConformanceLevel.Document;
                 settings.IgnoreComments = true;
                 settings.IgnoreWhitespace = true;

                 Animation TempAnimation = new Animation();
                 Frame TempFrame = new Frame();
                 TempFrame.LCollisionRects = new List<Rectangle>();

                 using (XmlReader reader = XmlReader.Create(openFileDialog1.FileName, settings))
                 {
                     reader.MoveToContent();
                     if (reader.Name == "Animations")
                     {
                         customControl11.data.Animations = new List<Animation>();
                         customControl11.data.CzFileName = reader["File"];

                     }
                     
                     else
                     {
                         throw new XmlException("not an animation file");
                     }

                     while (reader.Read())
                     {



                         if (reader.Name == "Name")
                         {
                             TempAnimation.CzAnimationName = reader.ReadString();
                             listBox2.Items.Add(TempAnimation.CzAnimationName);
                         }
                         if (reader.Name == "Frame")
                         {
                             TempFrame.NFrameNumber = Convert.ToInt32(reader["Number"]);
                             string[] FrameRect = reader["FrameRect"].Split(',');

                             Rectangle temp = new Rectangle();
                             temp.Y = Convert.ToInt32(FrameRect[0]);
                             temp.X = Convert.ToInt32(FrameRect[1]);
                             temp.Height = (Convert.ToInt32(FrameRect[2])) - temp.Y;
                             temp.Width = (Convert.ToInt32(FrameRect[3])) - temp.X;
                             TempFrame.RFrameRect = temp;

                             string[] AnchorPoint = reader["AnchorPoint"].Split(',');

                             Point temppt = new Point();

                             temppt.X = Convert.ToInt32(AnchorPoint[0]);
                             temppt.Y = Convert.ToInt32(AnchorPoint[1]);
                             TempFrame.PtAnchorPoint = temppt;
                             reader.Read();

                             while (reader.Name == "CollisionBox")
                             {
                                 Rectangle Collrect = new Rectangle();
                                 string[] collrect = reader["CollisionRect"].Split(',');
                                 Collrect.Y = Convert.ToInt32(collrect[0]);
                                 Collrect.X = Convert.ToInt32(collrect[1]);
                                 Collrect.Height = (Convert.ToInt32(collrect[2])) - Collrect.Y;
                                 Collrect.Width = (Convert.ToInt32(collrect[3])) - Collrect.X;
                                 TempFrame.LCollisionRects.Add(Collrect);
                                 reader.Read();
                               
                                 if (reader.Name == "Frame" && !reader.IsStartElement())
                                 {
                                     TempAnimation.LFrames.Add(TempFrame);
                                     TempFrame = new Frame();
                                     TempFrame.LCollisionRects = new List<Rectangle>();

                                 }

                             }
                             while (reader.Name == "Trigger")
                             {
                                 TempFrame.FFrameTriggers = new List<Trigger>();
                                 Trigger TempTrigger = new Trigger();
                                 TempTrigger.NTriggerType = 0;
                                 TempTrigger.CzTrigger = reader["String"];
                                 reader.Read();
                                 if (reader.Name == "Frame" && !reader.IsStartElement())
                                 {
                                     TempAnimation.LFrames.Add(TempFrame);
                                     TempFrame = new Frame();
                                     TempFrame.LCollisionRects = new List<Rectangle>();

                                 }

                             }






                         }
                         if (reader.Name == "Animation")
                         {
                             if (reader.IsStartElement())
                             {
                                 TempAnimation = new Animation();
                                 TempFrame.LCollisionRects = new List<Rectangle>();
                                 TempAnimation.LFrames = new List<Frame>();

                             }
                             else
                             {
                                 TempAnimation.LFrames.Add(TempFrame);
                                 customControl11.data.Animations.Add(TempAnimation);
                                 TempFrame = new Frame();
                             }
                         }
                     } 


                 }

                 
                 customControl11.SpriteSheet = new Bitmap(customControl11.data.CzFileName);
                 customControl11.Invalidate();
             }
        }

        private void listBox2_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            FrameListBox.Items.Clear();

            customControl11.data.LoadedAnimation1 = customControl11.data.Animations[listBox2.SelectedIndex];
            
            for (int i = 0; i < customControl11.data.LoadedAnimation1.LFrames.Count; i++)
            {
               FrameListBox.Items.Add(i);
            }


        }

        private void listBox3_SelectedIndexChanged(object sender, EventArgs e)
        {
            

        }

        private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void binaryToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            SaveFileDialog dlg = new SaveFileDialog();
            dlg.Filter = "All Files|*.*|Animation Binary Files|*.abn";
            dlg.FilterIndex = 2;
            dlg.DefaultExt = "abn";

            if (customControl11.data.Animations.Count == 0)
            {
                MessageBox.Show("You haven't done any work yet... if you have, make sure to add the animation you made to the animation list.", "Do work son", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (DialogResult.OK == dlg.ShowDialog())
            {
                FileStream fs = File.Create(dlg.FileName);
                BinaryWriter writer = new BinaryWriter(fs);
                writer.Write(customControl11.data.CzFileName.Length);
                char[] buffer = new char[customControl11.data.CzFileName.Length];
                for (int i = 0; i < customControl11.data.CzFileName.Length; i++)
                {
                    buffer[i] = customControl11.data.CzFileName[i];
                }
                writer.Write(buffer);


                //Number Animations in the File
                writer.Write(customControl11.data.Animations.Count);
                for (int i = 0; i < customControl11.data.Animations.Count; i++)
                {
                    //Animation Name
                    writer.Write(customControl11.data.Animations[i].CzAnimationName);
                    //Animation Speed
                     writer.Write((double)customControl11.data.Animations[i].FAnimationSpeed);
                    //Loop or Ossiclate or BOTH?
                    writer.Write(customControl11.data.Animations[i].FLoopOrOssicilate);
                    

                    //Number of frames in the animation
                    writer.Write(customControl11.data.Animations[i].LFrames.Count);
                    for (int j = 0; j < customControl11.data.Animations[i].LFrames.Count; j++)
                    {
                        //Frame Number
                        writer.Write(customControl11.data.Animations[i].LFrames.Count);
                        
                        //Frame Duration
                        writer.Write((double)customControl11.data.Animations[i].LFrames[j].FFrameDuration);

                        //Anchor Point
                        writer.Write(customControl11.data.Animations[i].LFrames[j].PtAnchorPoint.X);
                        writer.Write(customControl11.data.Animations[i].LFrames[j].PtAnchorPoint.Y);

                        //Frame Rectangle
                        writer.Write(customControl11.data.Animations[i].LFrames[j].RFrameRect.Left);
                        writer.Write(customControl11.data.Animations[i].LFrames[j].RFrameRect.Top);
                        writer.Write(customControl11.data.Animations[i].LFrames[j].RFrameRect.Right);
                        writer.Write(customControl11.data.Animations[i].LFrames[j].RFrameRect.Bottom);

                        //Number of Triggers in the File
                        writer.Write(customControl11.data.Animations[i].LFrames[j].FFrameTriggers.Count);
                        for (int k = 0; k < customControl11.data.Animations[i].LFrames[j].FFrameTriggers.Count; k++)
                        {
                            //Trigger Type
                            writer.Write(customControl11.data.Animations[i].LFrames[j].FFrameTriggers[k].NTriggerType);

                            //Trigger
                            writer.Write(customControl11.data.Animations[i].LFrames[j].FFrameTriggers[k].CzTrigger);
                        }

                        //Number of Collsion Rectangles in the animation
                        writer.Write(customControl11.data.Animations[i].LFrames[j].LCollisionRects.Count);
                        for (int k = 0; k < customControl11.data.Animations[i].LFrames[j].LCollisionRects.Count; k++)
                        {
                            //Collision Rectangle
                            writer.Write(customControl11.data.Animations[i].LFrames[j].LCollisionRects[k].Left);
                            writer.Write(customControl11.data.Animations[i].LFrames[j].LCollisionRects[k].Top);
                            writer.Write(customControl11.data.Animations[i].LFrames[j].LCollisionRects[k].Right);
                            writer.Write(customControl11.data.Animations[i].LFrames[j].LCollisionRects[k].Bottom);
                        }
                                        


                    }
                }

                writer.Close();
                fs.Close();

            }

        }

        private void binaryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            if (DialogResult.OK == dlg.ShowDialog())
            {

                FileStream fs = File.OpenRead(dlg.FileName);
                BinaryReader reader= new BinaryReader(fs);
                
                List<Animation> templist = new List<Animation>();

                int lenght = reader.ReadInt32();
                customControl11.data.CzFileName = reader.ReadString();
                customControl11.SpriteSheet = new Bitmap(customControl11.data.CzFileName);

               //Number Animations in the File
                int NumberOfAnimations = reader.ReadInt32();
               //Animation Name
                
                Animation TempAnimation = new Animation();
                for(int i = 0; i < NumberOfAnimations; i++)
                {
                    TempAnimation.LFrames = new List<Frame>();
                    TempAnimation.CzAnimationName = reader.ReadString();

               //Animation Speed
                    TempAnimation.FAnimationSpeed = (float)reader.ReadDouble();                
               //Loop or Ossiclate or BOTH?
                    TempAnimation.FLoopOrOssicilate = reader.ReadInt32();
                    
               //Number of frames in the animation
                    int NumberofFrames = reader.ReadInt32();

                    for(int j = 0; j < NumberofFrames; j++)
                    {
                        Frame TempFrame = new Frame();
                        
               //Frame Number\
                        TempFrame.NFrameNumber = reader.ReadInt32();
               //Frame Duration
                        TempFrame.FFrameDuration = (float)reader.ReadDouble();
               //Anchor Point
                        Point TempPoint = new Point();
                        TempPoint.X = reader.ReadInt32();
                        TempPoint.Y = reader.ReadInt32();
                        TempFrame.PtAnchorPoint = TempPoint;

               //Frame Rectangle
                        Rectangle TempRect = new Rectangle();

                        TempRect.X = reader.ReadInt32();
                        TempRect.Y = reader.ReadInt32();

                        int right = reader.ReadInt32();
                        int bottom = reader.ReadInt32();

                        TempRect.Width = right - TempRect.X;
                        TempRect.Height = bottom - TempRect.Y;

                        TempFrame.RFrameRect = TempRect;


               //Number of Triggers in the File
                        int NumTriggers = reader.ReadInt32();

                        TempFrame.FFrameTriggers = new List<Trigger>();

                        for (int k = 0; k < NumTriggers; k++)
                        {
                            Trigger TempTrigger = new Trigger();
               //Trigger Type
                            TempTrigger.NTriggerType = reader.ReadInt32();
               //Trigger
                            TempTrigger.CzTrigger = reader.ReadString();

                            TempFrame.FFrameTriggers.Add(TempTrigger);

                        }
               
               //Number of Collsion Rectangles in the animation
                        int NumCollRect = reader.ReadInt32();
                        TempFrame.LCollisionRects = new List<Rectangle>();

                        for (int k = 0; k < NumCollRect; k++)
                        {
                //Collision Rectangle
                            Rectangle TempRect2 = new Rectangle();

                            TempRect2.X = reader.ReadInt32();
                            TempRect2.Y = reader.ReadInt32();

                            int right2 = reader.ReadInt32();
                            int bottom2 = reader.ReadInt32();

                            TempRect2.Width = right2 - TempRect2.X;
                            TempRect2.Height = bottom2 - TempRect2.Y;
                            TempFrame.LCollisionRects.Add(TempRect2);
                         }
                         TempAnimation.LFrames.Add(TempFrame);
                    }

                    listBox2.Items.Add(TempAnimation.CzAnimationName);
                    templist.Add(TempAnimation);
                    TempAnimation = new Animation();
                }

                customControl11.data.Animations = templist;
                reader.Close();
                fs.Close();

                
        

            }
        }

    }


    //StringBuilder builder = new StringBuilder();
    //for (int x = 0; x < mapControl1.MapSize.Width; x++)
    //{
    //    builder.Append(Convert.ToString(tileSetControl1.PointToIndex(mapControl1[x, y])));
    //    builder.Append(',');
    //}

    //writer.WriteElementString("Row", builder.ToString().TrimEnd(','));

    public class storage
        {

            private string czFileName;

            public string CzFileName
            {
                get { return czFileName; }
                set { czFileName = value; }
            }


            private Animation LoadedAnimation = new Animation();

            public Animation LoadedAnimation1
            {
                get { return LoadedAnimation; }
                set { LoadedAnimation = value; }
            }
            private Frame LoadedFrame = new Frame();

            public Frame LoadedFrame1
            {
                get { return LoadedFrame; }
                set { LoadedFrame = value; }
            }

            private int loadedframenumber;

            public int Loadedframenumber
            {
                get { return loadedframenumber; }
                set { loadedframenumber = value; }
            }

            private List<Animation> animations = new List<Animation>();

            public List<Animation> Animations
            {
                get { return animations; }
                set { animations = value; }
            }
        }
    }
